package com.atguigu.day03;

import org.apache.flink.api.common.RuntimeExecutionMode;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author Felix
 * @date 2024/7/10
 * 该案例演示了执行模式的指定
 *      可以通过如下两种方式设置执行模式
 *          env.setRuntimeMode(RuntimeExecutionMode.BATCH);
 *          提交作业的时候加参数  -Dexecution.runtime-mode=BATCH
 */
public class Flink02_Exe_M {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setRuntimeMode(RuntimeExecutionMode.BATCH);
        DataStreamSource<String> ds = env.readTextFile("D:\\dev\\workspace\\bigdata-0221\\input\\wc.txt");
        ds.print();
        env.execute();
    }
}
